package com.yao.utils;

/**
 * User: 姚宏武
 * Date: 2017/11/27
 * Time: 14:09
 * Email：401369870@qq.com
 * Description:
 */
public class MathUtil {
    public static final Double MONEY_RANGE = 0.01;

    /**
     * 判断2个金额是否相等
     *
     * @param d1
     * @param d2
     * @return
     */
    public static Boolean equals(Double d1, Double d2) {
        Double result = Math.abs(d1 - d2);
        if (result < MONEY_RANGE) {
            return true;
        } else {
            return false;
        }
    }
}
